Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Initial support for Ruby Rack applications#55

Closed
montekki wants to merge 1 commit into
nginx:masterfrom
montekki:ruby-rack-support
Closed

Initial support for Ruby Rack applications#55
montekki wants to merge 1 commit into
nginx:masterfrom
montekki:ruby-rack-support

Conversation

@montekki
Copy link
Copy Markdown

Hi all. Decided to send in the patchset so the code doesn't get uselessly lost. A WIP now, code is somewhat hairy, but workable towards production.

Things not done yet:

  • correct ruby installation detection similar to php-config. Ruby has no such script, so code now defaults to 2.3.0 ubuntu build and may be configured with ./configure ruby --lib-path=/usr/lib/x86_64-linux-gnu/
  • support for different and antique ruby versions (say, 1.9.0)
  • not all rack variables are set
  • etc.

Tested with the following config file:

{
    "listeners" : {
        "*:8300" : {
            "application" : "rack"
        }
    },
    "applications": {
        "rack" : {
            "type": "ruby",
            "workers" : 1,
            "rack_root" : "$HOME_PATH/unit/",
            "rack_script": "app.ru"
        }
    }
}

AB testing resulted in

Document Path:          /
Document Length:        0 bytes

Concurrency Level:      1000
Time taken for tests:   0.430 seconds
Complete requests:      10000
Failed requests:        0
Total transferred:      820000 bytes
HTML transferred:       0 bytes
Requests per second:    23279.15 [#/sec] (mean)
Time per request:       42.957 [ms] (mean)
Time per request:       0.043 [ms] (mean, across all concurrent requests)
Transfer rate:          1864.15 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    5   3.9      3      20
Processing:     3   32  69.9     11     406
Waiting:        2   30  70.3      8     405
Total:          6   37  71.7     20     416

Let's talk fixes and I will be adding them to this branch.

@VBart
Copy link
Copy Markdown
Contributor

VBart commented Apr 2, 2018

Implemented in 37051b6.

@VBart VBart closed this Apr 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants